<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组的应用</title>
</head>
<body>
    <script>
        let fruit = "apple,orange,peach,banana";//=>apple-orange-peach-banana
        console.log("fruit",fruit);
        let arrList = fruit.split(",");
        console.log("arrList",arrList);
        let str = arrList.join("-");
        console.log("str",str)
    </script>
</body>
</html>